Video abstract for "An Adaptive Homeostatic Algorithm for the Unsupervised Learning of Visual Features"

This video shows the results of unsupervised learning with different type of kezrnel normalization. This is to illustrate the results obtained in this paper on the An Adaptive Homeostatic Algorithm for the Unsupervised Learning of Visual Features which is now in press.



In [1]:
%matplotlib inline
In [2]:
%load_ext autoreload
%autoreload 2
In [3]:
%ls -l /tmp/cache_dir /tmp/2019-09-11*
ls: /tmp/2019-09-11*: No such file or directory
ls: /tmp/cache_dir: No such file or directory
In [4]:
%ls -ltr /tmp/2019-09-11*
ls: /tmp/2019-09-11*: No such file or directory
%rm /tmp/cache_dir/*lock* %rm /tmp/2019-09-11* %rm /tmp/2019-09-11_Perrinet19_None_*.png%rm /tmp/cache_dir/*
In [5]:
%%writefile /tmp/video_abstract.py
import os
import numpy as np
seed = 51
np.random.seed(seed)

from shl_scripts.shl_experiments import SHL
name = '2019-09-11_Perrinet19'

datapath = '/tmp/database'
opts = dict(datapath=datapath, verbose=True, cache_dir='/tmp/cache_dir', n_iter=2**5 + 1, seed=seed)
shl = SHL(**opts)
data = shl.get_data(matname=f'{name}_data')

homeo_methods = ['None', 'OLS', 'HEH', 'HAP']
N_step = 18

d_new, d_old = 1, 1
fibo = [d_old]
for i_step in range(N_step+1):
    fibo.append(d_new)
    d_new, d_old = d_new + d_old, d_new
print('Fibonacci=', fibo)

from shl_scripts import touch
#from shl_scripts.shl_experiments import SHL_set
for homeo_method in homeo_methods:
    print(f'=> homeo_method={homeo_method}')
    flockname = os.path.join(shl.cache_dir, f'{name}_{homeo_method}_lock')
    if not os.path.isfile(flockname):
        touch(flockname)        
        dictionary, P_cum = None, None
        opts_ = opts.copy()
        opts_.update(homeo_method=homeo_method, n_iter=1,)
        shl = SHL(**opts_)
        for i_step in range(N_step):
            print(f'==> i_iter={i_step} / n_iter={fibo[i_step+1]}')
            shl.n_iter = fibo[i_step]
            dico = shl.learn_dico(data=data, dictionary=dictionary, P_cum=P_cum, matname=f'{name}_{homeo_method}_{i_step}')
            dictionary = dico.dictionary
            P_cum = dico.P_cum
                          
        if os.path.isfile(flockname): os.remove(flockname)
                       
Overwriting /tmp/video_abstract.py
In [6]:
%run  /tmp/video_abstract.py
Extracting data..No cache found /tmp/cache_dir/2019-09-11_Perrinet19_data_data: Extracting data... Extracting data..rocky10.png, bora04.png, yose07.png, cattails70.png, geyser27.png, hibiscus30.png, yellowleaves39.png, koala52.png, bird08.png, clouds43.png, flowerhill29.png, calcoast09.png, reflection63.png, cucorn50.png, goldwater67.png, yose05.png, woods54.png, flowers37.png, bittern62.png, craterlake12.png, Data is of shape : (65520, 441) - done in 8.01s.
Data is of shape : (65520, 441) - done in 8.92s.
Fibonacci= [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765]
=> homeo_method=None
==> i_iter=0 / n_iter=1
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_0_dico.pkl: Learning the dictionary with algo = mp 
 Training on 65520 patches
[dict_learning] Iteration   1 /    1 (elapsed time:   1s,   0mn   1s)
done in 3.67s.
==> i_iter=1 / n_iter=2
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_1_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_1_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    1 (elapsed time:   1s,   0mn   1s)
done in 2.72s.
==> i_iter=2 / n_iter=3
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_2_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_2_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    2 (elapsed time:   1s,   0mn   1s)
done in 3.86s.
==> i_iter=3 / n_iter=5
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_3_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_3_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    3 (elapsed time:   1s,   0mn   1s)
done in 5.13s.
==> i_iter=4 / n_iter=8
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_4_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_4_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    5 (elapsed time:   1s,   0mn   1s)
done in 7.47s.
==> i_iter=5 / n_iter=13
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_5_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_5_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    8 (elapsed time:   1s,   0mn   1s)
done in 11.35s.
==> i_iter=6 / n_iter=21
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_6_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_6_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   13 (elapsed time:   1s,   0mn   1s)
done in 18.29s.
==> i_iter=7 / n_iter=34
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_7_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_7_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   21 (elapsed time:   1s,   0mn   1s)
done in 28.28s.
==> i_iter=8 / n_iter=55
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_8_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_8_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   34 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   34 (elapsed time:  41s,   0mn  41s)
done in 44.14s.
==> i_iter=9 / n_iter=89
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_9_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_9_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   55 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   55 (elapsed time:  41s,   0mn  41s)
done in 70.25s.
==> i_iter=10 / n_iter=144
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_10_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_10_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   89 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   89 (elapsed time:  41s,   0mn  41s)
Iteration  65 /   89 (elapsed time:  82s,   1mn  22s)
done in 112.93s.
==> i_iter=11 / n_iter=233
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_11_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_11_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   144 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   144 (elapsed time:  41s,   0mn  41s)
Iteration  65 /   144 (elapsed time:  81s,   1mn  21s)
Iteration  97 /   144 (elapsed time:  122s,   2mn   2s)
Iteration  129 /   144 (elapsed time:  162s,   2mn  42s)
done in 182.37s.
==> i_iter=12 / n_iter=377
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_12_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_12_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   233 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   233 (elapsed time:  41s,   0mn  41s)
Iteration  65 /   233 (elapsed time:  82s,   1mn  22s)
Iteration  97 /   233 (elapsed time:  122s,   2mn   2s)
Iteration  129 /   233 (elapsed time:  163s,   2mn  43s)
Iteration  161 /   233 (elapsed time:  203s,   3mn  23s)
Iteration  193 /   233 (elapsed time:  244s,   4mn   4s)
Iteration  225 /   233 (elapsed time:  285s,   4mn  45s)
done in 296.42s.
==> i_iter=13 / n_iter=610
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_13_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_13_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   377 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   377 (elapsed time:  41s,   0mn  41s)
Iteration  65 /   377 (elapsed time:  82s,   1mn  22s)
Iteration  97 /   377 (elapsed time:  122s,   2mn   2s)
Iteration  129 /   377 (elapsed time:  163s,   2mn  43s)
Iteration  161 /   377 (elapsed time:  203s,   3mn  23s)
Iteration  193 /   377 (elapsed time:  244s,   4mn   4s)
Iteration  225 /   377 (elapsed time:  284s,   4mn  44s)
Iteration  257 /   377 (elapsed time:  325s,   5mn  25s)
Iteration  289 /   377 (elapsed time:  366s,   6mn   6s)
Iteration  321 /   377 (elapsed time:  406s,   6mn  46s)
Iteration  353 /   377 (elapsed time:  447s,   7mn  27s)
done in 477.94s.
==> i_iter=14 / n_iter=987
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_14_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_14_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   610 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   610 (elapsed time:  41s,   0mn  41s)
Iteration  65 /   610 (elapsed time:  82s,   1mn  22s)
Iteration  97 /   610 (elapsed time:  123s,   2mn   3s)
Iteration  129 /   610 (elapsed time:  163s,   2mn  43s)
Iteration  161 /   610 (elapsed time:  204s,   3mn  24s)
Iteration  193 /   610 (elapsed time:  245s,   4mn   5s)
Iteration  225 /   610 (elapsed time:  286s,   4mn  46s)
Iteration  257 /   610 (elapsed time:  327s,   5mn  27s)
Iteration  289 /   610 (elapsed time:  368s,   6mn   8s)
Iteration  321 /   610 (elapsed time:  409s,   6mn  49s)
Iteration  353 /   610 (elapsed time:  451s,   7mn  31s)
Iteration  385 /   610 (elapsed time:  491s,   8mn  11s)
Iteration  417 /   610 (elapsed time:  532s,   8mn  52s)
Iteration  449 /   610 (elapsed time:  573s,   9mn  33s)
Iteration  481 /   610 (elapsed time:  614s,  10mn  14s)
Iteration  513 /   610 (elapsed time:  655s,  10mn  55s)
Iteration  545 /   610 (elapsed time:  696s,  11mn  36s)
Iteration  577 /   610 (elapsed time:  736s,  12mn  16s)
Iteration  609 /   610 (elapsed time:  777s,  12mn  57s)
done in 780.00s.
==> i_iter=15 / n_iter=1597
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_15_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_15_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   987 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   987 (elapsed time:  41s,   0mn  41s)
Iteration  65 /   987 (elapsed time:  82s,   1mn  22s)
Iteration  97 /   987 (elapsed time:  122s,   2mn   2s)
Iteration  129 /   987 (elapsed time:  163s,   2mn  43s)
Iteration  161 /   987 (elapsed time:  204s,   3mn  24s)
Iteration  193 /   987 (elapsed time:  244s,   4mn   4s)
Iteration  225 /   987 (elapsed time:  285s,   4mn  45s)
Iteration  257 /   987 (elapsed time:  326s,   5mn  26s)
Iteration  289 /   987 (elapsed time:  366s,   6mn   6s)
Iteration  321 /   987 (elapsed time:  407s,   6mn  47s)
Iteration  353 /   987 (elapsed time:  448s,   7mn  28s)
Iteration  385 /   987 (elapsed time:  488s,   8mn   8s)
Iteration  417 /   987 (elapsed time:  529s,   8mn  49s)
Iteration  449 /   987 (elapsed time:  569s,   9mn  29s)
Iteration  481 /   987 (elapsed time:  610s,  10mn  10s)
Iteration  513 /   987 (elapsed time:  651s,  10mn  51s)
Iteration  545 /   987 (elapsed time:  692s,  11mn  32s)
Iteration  577 /   987 (elapsed time:  733s,  12mn  13s)
Iteration  609 /   987 (elapsed time:  774s,  12mn  54s)
Iteration  641 /   987 (elapsed time:  815s,  13mn  35s)
Iteration  673 /   987 (elapsed time:  855s,  14mn  15s)
Iteration  705 /   987 (elapsed time:  896s,  14mn  56s)
Iteration  737 /   987 (elapsed time:  937s,  15mn  37s)
Iteration  769 /   987 (elapsed time:  977s,  16mn  17s)
Iteration  801 /   987 (elapsed time:  1018s,  16mn  58s)
Iteration  833 /   987 (elapsed time:  1059s,  17mn  39s)
Iteration  865 /   987 (elapsed time:  1099s,  18mn  19s)
Iteration  897 /   987 (elapsed time:  1140s,  19mn   0s)
Iteration  929 /   987 (elapsed time:  1181s,  19mn  41s)
Iteration  961 /   987 (elapsed time:  1221s,  20mn  21s)
done in 1255.13s.
==> i_iter=16 / n_iter=2584
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_16_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_16_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   1597 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   1597 (elapsed time:  41s,   0mn  41s)
Iteration  65 /   1597 (elapsed time:  83s,   1mn  23s)
Iteration  97 /   1597 (elapsed time:  125s,   2mn   5s)
Iteration  129 /   1597 (elapsed time:  167s,   2mn  47s)
Iteration  161 /   1597 (elapsed time:  208s,   3mn  28s)
Iteration  193 /   1597 (elapsed time:  250s,   4mn  10s)
Iteration  225 /   1597 (elapsed time:  291s,   4mn  51s)
Iteration  257 /   1597 (elapsed time:  333s,   5mn  33s)
Iteration  289 /   1597 (elapsed time:  374s,   6mn  14s)
Iteration  321 /   1597 (elapsed time:  416s,   6mn  56s)
Iteration  353 /   1597 (elapsed time:  457s,   7mn  37s)
Iteration  385 /   1597 (elapsed time:  499s,   8mn  19s)
Iteration  417 /   1597 (elapsed time:  540s,   9mn   0s)
Iteration  449 /   1597 (elapsed time:  581s,   9mn  41s)
Iteration  481 /   1597 (elapsed time:  622s,  10mn  22s)
Iteration  513 /   1597 (elapsed time:  664s,  11mn   4s)
Iteration  545 /   1597 (elapsed time:  705s,  11mn  45s)
Iteration  577 /   1597 (elapsed time:  747s,  12mn  27s)
Iteration  609 /   1597 (elapsed time:  788s,  13mn   8s)
Iteration  641 /   1597 (elapsed time:  829s,  13mn  49s)
Iteration  673 /   1597 (elapsed time:  871s,  14mn  31s)
Iteration  705 /   1597 (elapsed time:  912s,  15mn  12s)
Iteration  737 /   1597 (elapsed time:  953s,  15mn  53s)
Iteration  769 /   1597 (elapsed time:  995s,  16mn  35s)
Iteration  801 /   1597 (elapsed time:  1036s,  17mn  16s)
Iteration  833 /   1597 (elapsed time:  1077s,  17mn  57s)
Iteration  865 /   1597 (elapsed time:  1119s,  18mn  39s)
Iteration  897 /   1597 (elapsed time:  1160s,  19mn  20s)
Iteration  929 /   1597 (elapsed time:  1201s,  20mn   1s)
Iteration  961 /   1597 (elapsed time:  1242s,  20mn  42s)
Iteration  993 /   1597 (elapsed time:  1283s,  21mn  23s)
Iteration  1025 /   1597 (elapsed time:  1324s,  22mn   4s)
Iteration  1057 /   1597 (elapsed time:  1365s,  22mn  45s)
Iteration  1089 /   1597 (elapsed time:  1406s,  23mn  26s)
Iteration  1121 /   1597 (elapsed time:  1447s,  24mn   7s)
Iteration  1153 /   1597 (elapsed time:  1489s,  24mn  49s)
Iteration  1185 /   1597 (elapsed time:  1530s,  25mn  30s)
Iteration  1217 /   1597 (elapsed time:  1571s,  26mn  11s)
Iteration  1249 /   1597 (elapsed time:  1612s,  26mn  52s)
Iteration  1281 /   1597 (elapsed time:  1653s,  27mn  33s)
Iteration  1313 /   1597 (elapsed time:  1694s,  28mn  14s)
Iteration  1345 /   1597 (elapsed time:  1736s,  28mn  56s)
Iteration  1377 /   1597 (elapsed time:  1777s,  29mn  37s)
Iteration  1409 /   1597 (elapsed time:  1819s,  30mn  19s)
Iteration  1441 /   1597 (elapsed time:  1860s,  31mn   0s)
Iteration  1473 /   1597 (elapsed time:  1902s,  31mn  42s)
Iteration  1505 /   1597 (elapsed time:  1943s,  32mn  23s)
Iteration  1537 /   1597 (elapsed time:  1984s,  33mn   4s)
Iteration  1569 /   1597 (elapsed time:  2025s,  33mn  45s)
done in 2061.26s.
==> i_iter=17 / n_iter=4181
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_None_17_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_None_17_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   2584 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   2584 (elapsed time:  41s,   0mn  41s)
Iteration  65 /   2584 (elapsed time:  82s,   1mn  22s)
Iteration  97 /   2584 (elapsed time:  123s,   2mn   3s)
Iteration  129 /   2584 (elapsed time:  164s,   2mn  44s)
Iteration  161 /   2584 (elapsed time:  205s,   3mn  25s)
Iteration  193 /   2584 (elapsed time:  245s,   4mn   5s)
Iteration  225 /   2584 (elapsed time:  286s,   4mn  46s)
Iteration  257 /   2584 (elapsed time:  327s,   5mn  27s)
Iteration  289 /   2584 (elapsed time:  368s,   6mn   8s)
Iteration  321 /   2584 (elapsed time:  409s,   6mn  49s)
Iteration  353 /   2584 (elapsed time:  449s,   7mn  29s)
Iteration  385 /   2584 (elapsed time:  490s,   8mn  10s)
Iteration  417 /   2584 (elapsed time:  531s,   8mn  51s)
Iteration  449 /   2584 (elapsed time:  571s,   9mn  31s)
Iteration  481 /   2584 (elapsed time:  612s,  10mn  12s)
Iteration  513 /   2584 (elapsed time:  653s,  10mn  53s)
Iteration  545 /   2584 (elapsed time:  693s,  11mn  33s)
Iteration  577 /   2584 (elapsed time:  734s,  12mn  14s)
Iteration  609 /   2584 (elapsed time:  775s,  12mn  55s)
Iteration  641 /   2584 (elapsed time:  815s,  13mn  35s)
Iteration  673 /   2584 (elapsed time:  856s,  14mn  16s)
Iteration  705 /   2584 (elapsed time:  897s,  14mn  57s)
Iteration  737 /   2584 (elapsed time:  938s,  15mn  38s)
Iteration  769 /   2584 (elapsed time:  979s,  16mn  19s)
Iteration  801 /   2584 (elapsed time:  1020s,  17mn   0s)
Iteration  833 /   2584 (elapsed time:  1060s,  17mn  40s)
Iteration  865 /   2584 (elapsed time:  1101s,  18mn  21s)
Iteration  897 /   2584 (elapsed time:  1142s,  19mn   2s)
Iteration  929 /   2584 (elapsed time:  1183s,  19mn  43s)
Iteration  961 /   2584 (elapsed time:  1224s,  20mn  24s)
Iteration  993 /   2584 (elapsed time:  1264s,  21mn   4s)
Iteration  1025 /   2584 (elapsed time:  1305s,  21mn  45s)
Iteration  1057 /   2584 (elapsed time:  1346s,  22mn  26s)
Iteration  1089 /   2584 (elapsed time:  1387s,  23mn   7s)
Iteration  1121 /   2584 (elapsed time:  1428s,  23mn  48s)
Iteration  1153 /   2584 (elapsed time:  1471s,  24mn  31s)
Iteration  1185 /   2584 (elapsed time:  1512s,  25mn  12s)
Iteration  1217 /   2584 (elapsed time:  1554s,  25mn  54s)
Iteration  1249 /   2584 (elapsed time:  1596s,  26mn  36s)
Iteration  1281 /   2584 (elapsed time:  1637s,  27mn  17s)
Iteration  1313 /   2584 (elapsed time:  1678s,  27mn  58s)
Iteration  1345 /   2584 (elapsed time:  1720s,  28mn  40s)
Iteration  1377 /   2584 (elapsed time:  1761s,  29mn  21s)
Iteration  1409 /   2584 (elapsed time:  1802s,  30mn   2s)
Iteration  1441 /   2584 (elapsed time:  1844s,  30mn  44s)
Iteration  1473 /   2584 (elapsed time:  1885s,  31mn  25s)
Iteration  1505 /   2584 (elapsed time:  1927s,  32mn   7s)
Iteration  1537 /   2584 (elapsed time:  1968s,  32mn  48s)
Iteration  1569 /   2584 (elapsed time:  2009s,  33mn  29s)
Iteration  1601 /   2584 (elapsed time:  2050s,  34mn  10s)
Iteration  1633 /   2584 (elapsed time:  2092s,  34mn  52s)
Iteration  1665 /   2584 (elapsed time:  2133s,  35mn  33s)
Iteration  1697 /   2584 (elapsed time:  2174s,  36mn  14s)
Iteration  1729 /   2584 (elapsed time:  2215s,  36mn  55s)
Iteration  1761 /   2584 (elapsed time:  2257s,  37mn  37s)
Iteration  1793 /   2584 (elapsed time:  2298s,  38mn  18s)
Iteration  1825 /   2584 (elapsed time:  2340s,  39mn   0s)
Iteration  1857 /   2584 (elapsed time:  2381s,  39mn  41s)
Iteration  1889 /   2584 (elapsed time:  2423s,  40mn  23s)
Iteration  1921 /   2584 (elapsed time:  2464s,  41mn   4s)
Iteration  1953 /   2584 (elapsed time:  2505s,  41mn  45s)
Iteration  1985 /   2584 (elapsed time:  2546s,  42mn  26s)
Iteration  2017 /   2584 (elapsed time:  2587s,  43mn   7s)
Iteration  2049 /   2584 (elapsed time:  2628s,  43mn  48s)
Iteration  2081 /   2584 (elapsed time:  2668s,  44mn  28s)
Iteration  2113 /   2584 (elapsed time:  2709s,  45mn   9s)
Iteration  2145 /   2584 (elapsed time:  2750s,  45mn  50s)
Iteration  2177 /   2584 (elapsed time:  2791s,  46mn  31s)
Iteration  2209 /   2584 (elapsed time:  2832s,  47mn  12s)
Iteration  2241 /   2584 (elapsed time:  2872s,  47mn  52s)
Iteration  2273 /   2584 (elapsed time:  2913s,  48mn  33s)
Iteration  2305 /   2584 (elapsed time:  2954s,  49mn  14s)
Iteration  2337 /   2584 (elapsed time:  2995s,  49mn  55s)
Iteration  2369 /   2584 (elapsed time:  3036s,  50mn  36s)
Iteration  2401 /   2584 (elapsed time:  3076s,  51mn  16s)
Iteration  2433 /   2584 (elapsed time:  3117s,  51mn  57s)
Iteration  2465 /   2584 (elapsed time:  3158s,  52mn  38s)
Iteration  2497 /   2584 (elapsed time:  3199s,  53mn  19s)
Iteration  2529 /   2584 (elapsed time:  3239s,  53mn  59s)
Iteration  2561 /   2584 (elapsed time:  3280s,  54mn  40s)
done in 3310.45s.
=> homeo_method=OLS
==> i_iter=0 / n_iter=1
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_0_dico.pkl: Learning the dictionary with algo = mp 
 Training on 65520 patches
[dict_learning] Iteration   1 /    1 (elapsed time:   1s,   0mn   1s)
done in 2.77s.
==> i_iter=1 / n_iter=2
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_1_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_1_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    1 (elapsed time:   1s,   0mn   1s)
done in 2.66s.
==> i_iter=2 / n_iter=3
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_2_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_2_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    2 (elapsed time:   1s,   0mn   1s)
done in 3.83s.
==> i_iter=3 / n_iter=5
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_3_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_3_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    3 (elapsed time:   1s,   0mn   1s)
done in 5.15s.
==> i_iter=4 / n_iter=8
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_4_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_4_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    5 (elapsed time:   1s,   0mn   1s)
done in 7.60s.
==> i_iter=5 / n_iter=13
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_5_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_5_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    8 (elapsed time:   1s,   0mn   1s)
done in 11.15s.
==> i_iter=6 / n_iter=21
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_6_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_6_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   13 (elapsed time:   1s,   0mn   1s)
done in 17.31s.
==> i_iter=7 / n_iter=34
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_7_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_7_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   21 (elapsed time:   1s,   0mn   1s)
done in 27.64s.
==> i_iter=8 / n_iter=55
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_8_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_8_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   34 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   34 (elapsed time:  41s,   0mn  41s)
done in 44.42s.
==> i_iter=9 / n_iter=89
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_9_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_9_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   55 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   55 (elapsed time:  42s,   0mn  42s)
done in 70.94s.
==> i_iter=10 / n_iter=144
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_10_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_10_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   89 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   89 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   89 (elapsed time:  83s,   1mn  23s)
done in 114.81s.
==> i_iter=11 / n_iter=233
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_11_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_11_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   144 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   144 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   144 (elapsed time:  83s,   1mn  23s)
Iteration  97 /   144 (elapsed time:  124s,   2mn   4s)
Iteration  129 /   144 (elapsed time:  166s,   2mn  46s)
done in 186.18s.
==> i_iter=12 / n_iter=377
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_12_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_12_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   233 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   233 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   233 (elapsed time:  83s,   1mn  23s)
Iteration  97 /   233 (elapsed time:  124s,   2mn   4s)
Iteration  129 /   233 (elapsed time:  165s,   2mn  45s)
Iteration  161 /   233 (elapsed time:  206s,   3mn  26s)
Iteration  193 /   233 (elapsed time:  247s,   4mn   7s)
Iteration  225 /   233 (elapsed time:  289s,   4mn  49s)
done in 300.59s.
==> i_iter=13 / n_iter=610
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_13_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_13_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   377 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   377 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   377 (elapsed time:  83s,   1mn  23s)
Iteration  97 /   377 (elapsed time:  124s,   2mn   4s)
Iteration  129 /   377 (elapsed time:  165s,   2mn  45s)
Iteration  161 /   377 (elapsed time:  207s,   3mn  27s)
Iteration  193 /   377 (elapsed time:  247s,   4mn   7s)
Iteration  225 /   377 (elapsed time:  289s,   4mn  49s)
Iteration  257 /   377 (elapsed time:  329s,   5mn  29s)
Iteration  289 /   377 (elapsed time:  370s,   6mn  10s)
Iteration  321 /   377 (elapsed time:  411s,   6mn  51s)
Iteration  353 /   377 (elapsed time:  453s,   7mn  33s)
done in 484.16s.
==> i_iter=14 / n_iter=987
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_14_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_14_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   610 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   610 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   610 (elapsed time:  83s,   1mn  23s)
Iteration  97 /   610 (elapsed time:  124s,   2mn   4s)
Iteration  129 /   610 (elapsed time:  166s,   2mn  46s)
Iteration  161 /   610 (elapsed time:  207s,   3mn  27s)
Iteration  193 /   610 (elapsed time:  248s,   4mn   8s)
Iteration  225 /   610 (elapsed time:  289s,   4mn  49s)
Iteration  257 /   610 (elapsed time:  331s,   5mn  31s)
Iteration  289 /   610 (elapsed time:  372s,   6mn  12s)
Iteration  321 /   610 (elapsed time:  413s,   6mn  53s)
Iteration  353 /   610 (elapsed time:  454s,   7mn  34s)
Iteration  385 /   610 (elapsed time:  496s,   8mn  16s)
Iteration  417 /   610 (elapsed time:  537s,   8mn  57s)
Iteration  449 /   610 (elapsed time:  578s,   9mn  38s)
Iteration  481 /   610 (elapsed time:  619s,  10mn  19s)
Iteration  513 /   610 (elapsed time:  660s,  11mn   0s)
Iteration  545 /   610 (elapsed time:  702s,  11mn  42s)
Iteration  577 /   610 (elapsed time:  743s,  12mn  23s)
Iteration  609 /   610 (elapsed time:  785s,  13mn   5s)
done in 788.47s.
==> i_iter=15 / n_iter=1597
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_15_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_15_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   987 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   987 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   987 (elapsed time:  84s,   1mn  24s)
Iteration  97 /   987 (elapsed time:  127s,   2mn   7s)
Iteration  129 /   987 (elapsed time:  169s,   2mn  49s)
Iteration  161 /   987 (elapsed time:  210s,   3mn  30s)
Iteration  193 /   987 (elapsed time:  252s,   4mn  12s)
Iteration  225 /   987 (elapsed time:  294s,   4mn  54s)
Iteration  257 /   987 (elapsed time:  336s,   5mn  36s)
Iteration  289 /   987 (elapsed time:  378s,   6mn  18s)
Iteration  321 /   987 (elapsed time:  419s,   6mn  59s)
Iteration  353 /   987 (elapsed time:  461s,   7mn  41s)
Iteration  385 /   987 (elapsed time:  503s,   8mn  23s)
Iteration  417 /   987 (elapsed time:  544s,   9mn   4s)
Iteration  449 /   987 (elapsed time:  586s,   9mn  46s)
Iteration  481 /   987 (elapsed time:  627s,  10mn  27s)
Iteration  513 /   987 (elapsed time:  669s,  11mn   9s)
Iteration  545 /   987 (elapsed time:  709s,  11mn  49s)
Iteration  577 /   987 (elapsed time:  751s,  12mn  31s)
Iteration  609 /   987 (elapsed time:  792s,  13mn  12s)
Iteration  641 /   987 (elapsed time:  833s,  13mn  53s)
Iteration  673 /   987 (elapsed time:  874s,  14mn  34s)
Iteration  705 /   987 (elapsed time:  915s,  15mn  15s)
Iteration  737 /   987 (elapsed time:  956s,  15mn  56s)
Iteration  769 /   987 (elapsed time:  997s,  16mn  37s)
Iteration  801 /   987 (elapsed time:  1039s,  17mn  19s)
Iteration  833 /   987 (elapsed time:  1080s,  18mn   0s)
Iteration  865 /   987 (elapsed time:  1121s,  18mn  41s)
Iteration  897 /   987 (elapsed time:  1162s,  19mn  22s)
Iteration  929 /   987 (elapsed time:  1203s,  20mn   3s)
Iteration  961 /   987 (elapsed time:  1244s,  20mn  44s)
done in 1278.54s.
==> i_iter=16 / n_iter=2584
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_16_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_16_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   1597 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   1597 (elapsed time:  43s,   0mn  43s)
Iteration  65 /   1597 (elapsed time:  84s,   1mn  24s)
Iteration  97 /   1597 (elapsed time:  125s,   2mn   5s)
Iteration  129 /   1597 (elapsed time:  166s,   2mn  46s)
Iteration  161 /   1597 (elapsed time:  208s,   3mn  28s)
Iteration  193 /   1597 (elapsed time:  249s,   4mn   9s)
Iteration  225 /   1597 (elapsed time:  290s,   4mn  50s)
Iteration  257 /   1597 (elapsed time:  331s,   5mn  31s)
Iteration  289 /   1597 (elapsed time:  373s,   6mn  13s)
Iteration  321 /   1597 (elapsed time:  414s,   6mn  54s)
Iteration  353 /   1597 (elapsed time:  455s,   7mn  35s)
Iteration  385 /   1597 (elapsed time:  496s,   8mn  16s)
Iteration  417 /   1597 (elapsed time:  537s,   8mn  57s)
Iteration  449 /   1597 (elapsed time:  578s,   9mn  38s)
Iteration  481 /   1597 (elapsed time:  619s,  10mn  19s)
Iteration  513 /   1597 (elapsed time:  660s,  11mn   0s)
Iteration  545 /   1597 (elapsed time:  702s,  11mn  42s)
Iteration  577 /   1597 (elapsed time:  743s,  12mn  23s)
Iteration  609 /   1597 (elapsed time:  784s,  13mn   4s)
Iteration  641 /   1597 (elapsed time:  825s,  13mn  45s)
Iteration  673 /   1597 (elapsed time:  866s,  14mn  26s)
Iteration  705 /   1597 (elapsed time:  908s,  15mn   8s)
Iteration  737 /   1597 (elapsed time:  949s,  15mn  49s)
Iteration  769 /   1597 (elapsed time:  991s,  16mn  31s)
Iteration  801 /   1597 (elapsed time:  1032s,  17mn  12s)
Iteration  833 /   1597 (elapsed time:  1073s,  17mn  53s)
Iteration  865 /   1597 (elapsed time:  1114s,  18mn  34s)
Iteration  897 /   1597 (elapsed time:  1155s,  19mn  15s)
Iteration  929 /   1597 (elapsed time:  1197s,  19mn  57s)
Iteration  961 /   1597 (elapsed time:  1238s,  20mn  38s)
Iteration  993 /   1597 (elapsed time:  1279s,  21mn  19s)
Iteration  1025 /   1597 (elapsed time:  1321s,  22mn   1s)
Iteration  1057 /   1597 (elapsed time:  1362s,  22mn  42s)
Iteration  1089 /   1597 (elapsed time:  1403s,  23mn  23s)
Iteration  1121 /   1597 (elapsed time:  1444s,  24mn   4s)
Iteration  1153 /   1597 (elapsed time:  1485s,  24mn  45s)
Iteration  1185 /   1597 (elapsed time:  1526s,  25mn  26s)
Iteration  1217 /   1597 (elapsed time:  1567s,  26mn   7s)
Iteration  1249 /   1597 (elapsed time:  1609s,  26mn  49s)
Iteration  1281 /   1597 (elapsed time:  1650s,  27mn  30s)
Iteration  1313 /   1597 (elapsed time:  1691s,  28mn  11s)
Iteration  1345 /   1597 (elapsed time:  1733s,  28mn  53s)
Iteration  1377 /   1597 (elapsed time:  1774s,  29mn  34s)
Iteration  1409 /   1597 (elapsed time:  1815s,  30mn  15s)
Iteration  1441 /   1597 (elapsed time:  1856s,  30mn  56s)
Iteration  1473 /   1597 (elapsed time:  1898s,  31mn  38s)
Iteration  1505 /   1597 (elapsed time:  1939s,  32mn  19s)
Iteration  1537 /   1597 (elapsed time:  1980s,  33mn   0s)
Iteration  1569 /   1597 (elapsed time:  2021s,  33mn  41s)
done in 2058.27s.
==> i_iter=17 / n_iter=4181
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_OLS_17_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_17_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   2584 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   2584 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   2584 (elapsed time:  83s,   1mn  23s)
Iteration  97 /   2584 (elapsed time:  124s,   2mn   4s)
Iteration  129 /   2584 (elapsed time:  166s,   2mn  46s)
Iteration  161 /   2584 (elapsed time:  207s,   3mn  27s)
Iteration  193 /   2584 (elapsed time:  250s,   4mn  10s)
Iteration  225 /   2584 (elapsed time:  292s,   4mn  52s)
Iteration  257 /   2584 (elapsed time:  334s,   5mn  34s)
Iteration  289 /   2584 (elapsed time:  375s,   6mn  15s)
Iteration  321 /   2584 (elapsed time:  417s,   6mn  57s)
Iteration  353 /   2584 (elapsed time:  459s,   7mn  39s)
Iteration  385 /   2584 (elapsed time:  500s,   8mn  20s)
Iteration  417 /   2584 (elapsed time:  542s,   9mn   2s)
Iteration  449 /   2584 (elapsed time:  584s,   9mn  44s)
Iteration  481 /   2584 (elapsed time:  626s,  10mn  26s)
Iteration  513 /   2584 (elapsed time:  669s,  11mn   9s)
Iteration  545 /   2584 (elapsed time:  711s,  11mn  51s)
Iteration  577 /   2584 (elapsed time:  752s,  12mn  32s)
Iteration  609 /   2584 (elapsed time:  794s,  13mn  14s)
Iteration  641 /   2584 (elapsed time:  836s,  13mn  56s)
Iteration  673 /   2584 (elapsed time:  878s,  14mn  38s)
Iteration  705 /   2584 (elapsed time:  920s,  15mn  20s)
Iteration  737 /   2584 (elapsed time:  961s,  16mn   1s)
Iteration  769 /   2584 (elapsed time:  1003s,  16mn  43s)
Iteration  801 /   2584 (elapsed time:  1044s,  17mn  24s)
Iteration  833 /   2584 (elapsed time:  1086s,  18mn   6s)
Iteration  865 /   2584 (elapsed time:  1127s,  18mn  47s)
Iteration  897 /   2584 (elapsed time:  1168s,  19mn  28s)
Iteration  929 /   2584 (elapsed time:  1210s,  20mn  10s)
Iteration  961 /   2584 (elapsed time:  1251s,  20mn  51s)
Iteration  993 /   2584 (elapsed time:  1292s,  21mn  32s)
Iteration  1025 /   2584 (elapsed time:  1333s,  22mn  13s)
Iteration  1057 /   2584 (elapsed time:  1375s,  22mn  55s)
Iteration  1089 /   2584 (elapsed time:  1416s,  23mn  36s)
Iteration  1121 /   2584 (elapsed time:  1457s,  24mn  17s)
Iteration  1153 /   2584 (elapsed time:  1498s,  24mn  58s)
Iteration  1185 /   2584 (elapsed time:  1540s,  25mn  40s)
Iteration  1217 /   2584 (elapsed time:  1581s,  26mn  21s)
Iteration  1249 /   2584 (elapsed time:  1622s,  27mn   2s)
Iteration  1281 /   2584 (elapsed time:  1663s,  27mn  43s)
Iteration  1313 /   2584 (elapsed time:  1704s,  28mn  24s)
Iteration  1345 /   2584 (elapsed time:  1746s,  29mn   6s)
Iteration  1377 /   2584 (elapsed time:  1787s,  29mn  47s)
Iteration  1409 /   2584 (elapsed time:  1829s,  30mn  29s)
Iteration  1441 /   2584 (elapsed time:  1870s,  31mn  10s)
Iteration  1473 /   2584 (elapsed time:  1911s,  31mn  51s)
Iteration  1505 /   2584 (elapsed time:  1953s,  32mn  33s)
Iteration  1537 /   2584 (elapsed time:  1994s,  33mn  14s)
Iteration  1569 /   2584 (elapsed time:  2035s,  33mn  55s)
Iteration  1601 /   2584 (elapsed time:  2076s,  34mn  36s)
Iteration  1633 /   2584 (elapsed time:  2118s,  35mn  18s)
Iteration  1665 /   2584 (elapsed time:  2159s,  35mn  59s)
Iteration  1697 /   2584 (elapsed time:  2200s,  36mn  40s)
Iteration  1729 /   2584 (elapsed time:  2241s,  37mn  21s)
Iteration  1761 /   2584 (elapsed time:  2282s,  38mn   2s)
Iteration  1793 /   2584 (elapsed time:  2323s,  38mn  43s)
Iteration  1825 /   2584 (elapsed time:  2365s,  39mn  25s)
Iteration  1857 /   2584 (elapsed time:  2407s,  40mn   7s)
Iteration  1889 /   2584 (elapsed time:  2448s,  40mn  48s)
Iteration  1921 /   2584 (elapsed time:  2489s,  41mn  29s)
Iteration  1953 /   2584 (elapsed time:  2531s,  42mn  11s)
Iteration  1985 /   2584 (elapsed time:  2572s,  42mn  52s)
Iteration  2017 /   2584 (elapsed time:  2613s,  43mn  33s)
Iteration  2049 /   2584 (elapsed time:  2655s,  44mn  15s)
Iteration  2081 /   2584 (elapsed time:  2696s,  44mn  56s)
Iteration  2113 /   2584 (elapsed time:  2737s,  45mn  37s)
Iteration  2145 /   2584 (elapsed time:  2778s,  46mn  18s)
Iteration  2177 /   2584 (elapsed time:  2820s,  47mn   0s)
Iteration  2209 /   2584 (elapsed time:  2861s,  47mn  41s)
Iteration  2241 /   2584 (elapsed time:  2902s,  48mn  22s)
Iteration  2273 /   2584 (elapsed time:  2943s,  49mn   3s)
Iteration  2305 /   2584 (elapsed time:  2984s,  49mn  44s)
Iteration  2337 /   2584 (elapsed time:  3025s,  50mn  25s)
Iteration  2369 /   2584 (elapsed time:  3066s,  51mn   6s)
Iteration  2401 /   2584 (elapsed time:  3107s,  51mn  47s)
Iteration  2433 /   2584 (elapsed time:  3148s,  52mn  28s)
Iteration  2465 /   2584 (elapsed time:  3189s,  53mn   9s)
Iteration  2497 /   2584 (elapsed time:  3230s,  53mn  50s)
Iteration  2529 /   2584 (elapsed time:  3271s,  54mn  31s)
Iteration  2561 /   2584 (elapsed time:  3312s,  55mn  12s)
done in 3342.66s.
=> homeo_method=HEH
==> i_iter=0 / n_iter=1
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_0_dico.pkl: Learning the dictionary with algo = mp 
 Training on 65520 patches
[dict_learning] Iteration   1 /    1 (elapsed time:   4s,   0mn   4s)
done in 7.83s.
==> i_iter=1 / n_iter=2
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_1_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_1_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    1 (elapsed time:   4s,   0mn   4s)
done in 7.72s.
==> i_iter=2 / n_iter=3
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_2_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_2_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    2 (elapsed time:   4s,   0mn   4s)
done in 12.02s.
==> i_iter=3 / n_iter=5
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_3_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_3_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    3 (elapsed time:   4s,   0mn   4s)
done in 16.68s.
==> i_iter=4 / n_iter=8
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_4_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_4_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    5 (elapsed time:   4s,   0mn   4s)
done in 25.80s.
==> i_iter=5 / n_iter=13
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_5_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_5_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    8 (elapsed time:   4s,   0mn   4s)
done in 39.58s.
==> i_iter=6 / n_iter=21
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_6_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_6_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   13 (elapsed time:   4s,   0mn   4s)
done in 62.65s.
==> i_iter=7 / n_iter=34
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_7_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_7_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   21 (elapsed time:   5s,   0mn   5s)
done in 104.56s.
==> i_iter=8 / n_iter=55
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_8_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_8_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   34 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   34 (elapsed time:  157s,   2mn  37s)
done in 164.81s.
==> i_iter=9 / n_iter=89
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_9_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_9_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   55 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   55 (elapsed time:  157s,   2mn  37s)
done in 263.08s.
==> i_iter=10 / n_iter=144
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_10_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_10_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   89 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   89 (elapsed time:  157s,   2mn  37s)
Iteration  65 /   89 (elapsed time:  308s,   5mn   8s)
done in 422.64s.
==> i_iter=11 / n_iter=233
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_11_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_11_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   144 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   144 (elapsed time:  155s,   2mn  35s)
Iteration  65 /   144 (elapsed time:  305s,   5mn   5s)
Iteration  97 /   144 (elapsed time:  455s,   7mn  35s)
Iteration  129 /   144 (elapsed time:  604s,  10mn   4s)
done in 675.69s.
==> i_iter=12 / n_iter=377
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_12_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_12_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   233 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   233 (elapsed time:  156s,   2mn  36s)
Iteration  65 /   233 (elapsed time:  306s,   5mn   6s)
Iteration  97 /   233 (elapsed time:  455s,   7mn  35s)
Iteration  129 /   233 (elapsed time:  605s,  10mn   5s)
Iteration  161 /   233 (elapsed time:  755s,  12mn  35s)
Iteration  193 /   233 (elapsed time:  904s,  15mn   4s)
Iteration  225 /   233 (elapsed time:  1054s,  17mn  34s)
done in 1094.03s.
==> i_iter=13 / n_iter=610
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_13_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_13_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   377 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   377 (elapsed time:  154s,   2mn  34s)
Iteration  65 /   377 (elapsed time:  306s,   5mn   6s)
Iteration  97 /   377 (elapsed time:  457s,   7mn  37s)
Iteration  129 /   377 (elapsed time:  609s,  10mn   9s)
Iteration  161 /   377 (elapsed time:  759s,  12mn  39s)
Iteration  193 /   377 (elapsed time:  908s,  15mn   8s)
Iteration  225 /   377 (elapsed time:  1063s,  17mn  43s)
Iteration  257 /   377 (elapsed time:  1217s,  20mn  17s)
Iteration  289 /   377 (elapsed time:  1369s,  22mn  49s)
Iteration  321 /   377 (elapsed time:  1523s,  25mn  23s)
Iteration  353 /   377 (elapsed time:  1675s,  27mn  55s)
done in 1788.38s.
==> i_iter=14 / n_iter=987
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_14_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_14_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   610 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   610 (elapsed time:  155s,   2mn  35s)
Iteration  65 /   610 (elapsed time:  306s,   5mn   6s)
Iteration  97 /   610 (elapsed time:  457s,   7mn  37s)
Iteration  129 /   610 (elapsed time:  608s,  10mn   8s)
Iteration  161 /   610 (elapsed time:  757s,  12mn  37s)
Iteration  193 /   610 (elapsed time:  907s,  15mn   7s)
Iteration  225 /   610 (elapsed time:  1057s,  17mn  37s)
Iteration  257 /   610 (elapsed time:  1206s,  20mn   6s)
Iteration  289 /   610 (elapsed time:  1358s,  22mn  38s)
Iteration  321 /   610 (elapsed time:  1508s,  25mn   8s)
Iteration  353 /   610 (elapsed time:  1658s,  27mn  38s)
Iteration  385 /   610 (elapsed time:  1807s,  30mn   7s)
Iteration  417 /   610 (elapsed time:  1958s,  32mn  38s)
Iteration  449 /   610 (elapsed time:  2109s,  35mn   9s)
Iteration  481 /   610 (elapsed time:  2258s,  37mn  38s)
Iteration  513 /   610 (elapsed time:  2407s,  40mn   7s)
Iteration  545 /   610 (elapsed time:  2556s,  42mn  36s)
Iteration  577 /   610 (elapsed time:  2707s,  45mn   7s)
Iteration  609 /   610 (elapsed time:  2863s,  47mn  43s)
done in 2870.93s.
==> i_iter=15 / n_iter=1597
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_15_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_15_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   987 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   987 (elapsed time:  157s,   2mn  37s)
Iteration  65 /   987 (elapsed time:  311s,   5mn  11s)
Iteration  97 /   987 (elapsed time:  463s,   7mn  43s)
Iteration  129 /   987 (elapsed time:  615s,  10mn  15s)
Iteration  161 /   987 (elapsed time:  765s,  12mn  45s)
Iteration  193 /   987 (elapsed time:  916s,  15mn  16s)
Iteration  225 /   987 (elapsed time:  1071s,  17mn  51s)
Iteration  257 /   987 (elapsed time:  1221s,  20mn  21s)
Iteration  289 /   987 (elapsed time:  1371s,  22mn  51s)
Iteration  321 /   987 (elapsed time:  1522s,  25mn  22s)
Iteration  353 /   987 (elapsed time:  1673s,  27mn  53s)
Iteration  385 /   987 (elapsed time:  1821s,  30mn  21s)
Iteration  417 /   987 (elapsed time:  1972s,  32mn  52s)
Iteration  449 /   987 (elapsed time:  2121s,  35mn  21s)
Iteration  481 /   987 (elapsed time:  2270s,  37mn  50s)
Iteration  513 /   987 (elapsed time:  2420s,  40mn  20s)
Iteration  545 /   987 (elapsed time:  2570s,  42mn  50s)
Iteration  577 /   987 (elapsed time:  2720s,  45mn  20s)
Iteration  609 /   987 (elapsed time:  2870s,  47mn  50s)
Iteration  641 /   987 (elapsed time:  3019s,  50mn  19s)
Iteration  673 /   987 (elapsed time:  3170s,  52mn  50s)
Iteration  705 /   987 (elapsed time:  3321s,  55mn  21s)
Iteration  737 /   987 (elapsed time:  3474s,  57mn  54s)
Iteration  769 /   987 (elapsed time:  3627s,  60mn  27s)
Iteration  801 /   987 (elapsed time:  3780s,  63mn   0s)
Iteration  833 /   987 (elapsed time:  3934s,  65mn  34s)
Iteration  865 /   987 (elapsed time:  4084s,  68mn   4s)
Iteration  897 /   987 (elapsed time:  4235s,  70mn  35s)
Iteration  929 /   987 (elapsed time:  4384s,  73mn   4s)
Iteration  961 /   987 (elapsed time:  4534s,  75mn  34s)
done in 4656.54s.
==> i_iter=16 / n_iter=2584
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_16_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_16_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   1597 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   1597 (elapsed time:  155s,   2mn  35s)
Iteration  65 /   1597 (elapsed time:  306s,   5mn   6s)
Iteration  97 /   1597 (elapsed time:  457s,   7mn  37s)
Iteration  129 /   1597 (elapsed time:  608s,  10mn   8s)
Iteration  161 /   1597 (elapsed time:  758s,  12mn  38s)
Iteration  193 /   1597 (elapsed time:  909s,  15mn   9s)
Iteration  225 /   1597 (elapsed time:  1059s,  17mn  39s)
Iteration  257 /   1597 (elapsed time:  1210s,  20mn  10s)
Iteration  289 /   1597 (elapsed time:  1358s,  22mn  38s)
Iteration  321 /   1597 (elapsed time:  1508s,  25mn   8s)
Iteration  353 /   1597 (elapsed time:  1658s,  27mn  38s)
Iteration  385 /   1597 (elapsed time:  1808s,  30mn   8s)
Iteration  417 /   1597 (elapsed time:  1959s,  32mn  39s)
Iteration  449 /   1597 (elapsed time:  2110s,  35mn  10s)
Iteration  481 /   1597 (elapsed time:  2259s,  37mn  39s)
Iteration  513 /   1597 (elapsed time:  2407s,  40mn   7s)
Iteration  545 /   1597 (elapsed time:  2558s,  42mn  38s)
Iteration  577 /   1597 (elapsed time:  2709s,  45mn   9s)
Iteration  609 /   1597 (elapsed time:  2863s,  47mn  43s)
Iteration  641 /   1597 (elapsed time:  3015s,  50mn  15s)
Iteration  673 /   1597 (elapsed time:  3169s,  52mn  49s)
Iteration  705 /   1597 (elapsed time:  3319s,  55mn  19s)
Iteration  737 /   1597 (elapsed time:  3471s,  57mn  51s)
Iteration  769 /   1597 (elapsed time:  3621s,  60mn  21s)
Iteration  801 /   1597 (elapsed time:  3770s,  62mn  50s)
Iteration  833 /   1597 (elapsed time:  3919s,  65mn  19s)
Iteration  865 /   1597 (elapsed time:  4068s,  67mn  48s)
Iteration  897 /   1597 (elapsed time:  4219s,  70mn  19s)
Iteration  929 /   1597 (elapsed time:  4368s,  72mn  48s)
Iteration  961 /   1597 (elapsed time:  4519s,  75mn  19s)
Iteration  993 /   1597 (elapsed time:  4669s,  77mn  49s)
Iteration  1025 /   1597 (elapsed time:  4819s,  80mn  19s)
Iteration  1057 /   1597 (elapsed time:  4969s,  82mn  49s)
Iteration  1089 /   1597 (elapsed time:  5118s,  85mn  18s)
Iteration  1121 /   1597 (elapsed time:  5268s,  87mn  48s)
Iteration  1153 /   1597 (elapsed time:  5420s,  90mn  20s)
Iteration  1185 /   1597 (elapsed time:  5569s,  92mn  49s)
Iteration  1217 /   1597 (elapsed time:  5718s,  95mn  18s)
Iteration  1249 /   1597 (elapsed time:  5868s,  97mn  48s)
Iteration  1281 /   1597 (elapsed time:  6021s,  100mn  21s)
Iteration  1313 /   1597 (elapsed time:  6174s,  102mn  54s)
Iteration  1345 /   1597 (elapsed time:  6326s,  105mn  26s)
Iteration  1377 /   1597 (elapsed time:  6479s,  107mn  59s)
Iteration  1409 /   1597 (elapsed time:  6632s,  110mn  32s)
Iteration  1441 /   1597 (elapsed time:  6782s,  113mn   2s)
Iteration  1473 /   1597 (elapsed time:  6931s,  115mn  31s)
Iteration  1505 /   1597 (elapsed time:  7081s,  118mn   1s)
Iteration  1537 /   1597 (elapsed time:  7232s,  120mn  32s)
Iteration  1569 /   1597 (elapsed time:  7383s,  123mn   3s)
done in 7514.95s.
==> i_iter=17 / n_iter=4181
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HEH_17_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_17_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   2584 (elapsed time:   4s,   0mn   4s)
Iteration  33 /   2584 (elapsed time:  155s,   2mn  35s)
Iteration  65 /   2584 (elapsed time:  306s,   5mn   6s)
Iteration  97 /   2584 (elapsed time:  457s,   7mn  37s)
Iteration  129 /   2584 (elapsed time:  608s,  10mn   8s)
Iteration  161 /   2584 (elapsed time:  757s,  12mn  37s)
Iteration  193 /   2584 (elapsed time:  907s,  15mn   7s)
Iteration  225 /   2584 (elapsed time:  1056s,  17mn  36s)
Iteration  257 /   2584 (elapsed time:  1206s,  20mn   6s)
Iteration  289 /   2584 (elapsed time:  1356s,  22mn  36s)
Iteration  321 /   2584 (elapsed time:  1506s,  25mn   6s)
Iteration  353 /   2584 (elapsed time:  1655s,  27mn  35s)
Iteration  385 /   2584 (elapsed time:  1804s,  30mn   4s)
Iteration  417 /   2584 (elapsed time:  1954s,  32mn  34s)
Iteration  449 /   2584 (elapsed time:  2104s,  35mn   4s)
Iteration  481 /   2584 (elapsed time:  2257s,  37mn  37s)
Iteration  513 /   2584 (elapsed time:  2410s,  40mn  10s)
Iteration  545 /   2584 (elapsed time:  2563s,  42mn  43s)
Iteration  577 /   2584 (elapsed time:  2716s,  45mn  16s)
Iteration  609 /   2584 (elapsed time:  2867s,  47mn  47s)
Iteration  641 /   2584 (elapsed time:  3017s,  50mn  17s)
Iteration  673 /   2584 (elapsed time:  3168s,  52mn  48s)
Iteration  705 /   2584 (elapsed time:  3319s,  55mn  19s)
Iteration  737 /   2584 (elapsed time:  3469s,  57mn  49s)
Iteration  769 /   2584 (elapsed time:  3619s,  60mn  19s)
Iteration  801 /   2584 (elapsed time:  3767s,  62mn  47s)
Iteration  833 /   2584 (elapsed time:  3919s,  65mn  19s)
Iteration  865 /   2584 (elapsed time:  4070s,  67mn  50s)
Iteration  897 /   2584 (elapsed time:  4221s,  70mn  21s)
Iteration  929 /   2584 (elapsed time:  4371s,  72mn  51s)
Iteration  961 /   2584 (elapsed time:  4520s,  75mn  20s)
Iteration  993 /   2584 (elapsed time:  4671s,  77mn  51s)
Iteration  1025 /   2584 (elapsed time:  4823s,  80mn  23s)
Iteration  1057 /   2584 (elapsed time:  4974s,  82mn  54s)
Iteration  1089 /   2584 (elapsed time:  5123s,  85mn  23s)
Iteration  1121 /   2584 (elapsed time:  5273s,  87mn  53s)
Iteration  1153 /   2584 (elapsed time:  5422s,  90mn  22s)
Iteration  1185 /   2584 (elapsed time:  5570s,  92mn  50s)
Iteration  1217 /   2584 (elapsed time:  5721s,  95mn  21s)
Iteration  1249 /   2584 (elapsed time:  5874s,  97mn  54s)
Iteration  1281 /   2584 (elapsed time:  6027s,  100mn  27s)
Iteration  1313 /   2584 (elapsed time:  6178s,  102mn  58s)
Iteration  1345 /   2584 (elapsed time:  6332s,  105mn  32s)
Iteration  1377 /   2584 (elapsed time:  6485s,  108mn   5s)
Iteration  1409 /   2584 (elapsed time:  6637s,  110mn  37s)
Iteration  1441 /   2584 (elapsed time:  6788s,  113mn   8s)
Iteration  1473 /   2584 (elapsed time:  6937s,  115mn  37s)
Iteration  1505 /   2584 (elapsed time:  7088s,  118mn   8s)
Iteration  1537 /   2584 (elapsed time:  7238s,  120mn  38s)
Iteration  1569 /   2584 (elapsed time:  7389s,  123mn   9s)
Iteration  1601 /   2584 (elapsed time:  7539s,  125mn  39s)
Iteration  1633 /   2584 (elapsed time:  7689s,  128mn   9s)
Iteration  1665 /   2584 (elapsed time:  7840s,  130mn  40s)
Iteration  1697 /   2584 (elapsed time:  7989s,  133mn   9s)
Iteration  1729 /   2584 (elapsed time:  8139s,  135mn  39s)
Iteration  1761 /   2584 (elapsed time:  8290s,  138mn  10s)
Iteration  1793 /   2584 (elapsed time:  8440s,  140mn  40s)
Iteration  1825 /   2584 (elapsed time:  8590s,  143mn  10s)
Iteration  1857 /   2584 (elapsed time:  8741s,  145mn  41s)
Iteration  1889 /   2584 (elapsed time:  8890s,  148mn  10s)
Iteration  1921 /   2584 (elapsed time:  9040s,  150mn  40s)
Iteration  1953 /   2584 (elapsed time:  9189s,  153mn   9s)
Iteration  1985 /   2584 (elapsed time:  9343s,  155mn  43s)
Iteration  2017 /   2584 (elapsed time:  9496s,  158mn  16s)
Iteration  2049 /   2584 (elapsed time:  9647s,  160mn  47s)
Iteration  2081 /   2584 (elapsed time:  9799s,  163mn  19s)
Iteration  2113 /   2584 (elapsed time:  9950s,  165mn  50s)
Iteration  2145 /   2584 (elapsed time:  10100s,  168mn  20s)
Iteration  2177 /   2584 (elapsed time:  10250s,  170mn  50s)
Iteration  2209 /   2584 (elapsed time:  10400s,  173mn  20s)
Iteration  2241 /   2584 (elapsed time:  10550s,  175mn  50s)
Iteration  2273 /   2584 (elapsed time:  10699s,  178mn  19s)
Iteration  2305 /   2584 (elapsed time:  10851s,  180mn  51s)
Iteration  2337 /   2584 (elapsed time:  11001s,  183mn  21s)
Iteration  2369 /   2584 (elapsed time:  11153s,  185mn  53s)
Iteration  2401 /   2584 (elapsed time:  11302s,  188mn  22s)
Iteration  2433 /   2584 (elapsed time:  11451s,  190mn  51s)
Iteration  2465 /   2584 (elapsed time:  11600s,  193mn  20s)
Iteration  2497 /   2584 (elapsed time:  11750s,  195mn  50s)
Iteration  2529 /   2584 (elapsed time:  11901s,  198mn  21s)
Iteration  2561 /   2584 (elapsed time:  12051s,  200mn  51s)
done in 12160.35s.
=> homeo_method=HAP
==> i_iter=0 / n_iter=1
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_0_dico.pkl: Learning the dictionary with algo = mp 
 Training on 65520 patches
[dict_learning] Iteration   1 /    1 (elapsed time:   1s,   0mn   1s)
done in 2.74s.
==> i_iter=1 / n_iter=2
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_1_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_1_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    1 (elapsed time:   1s,   0mn   1s)
done in 2.68s.
==> i_iter=2 / n_iter=3
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_2_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_2_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    2 (elapsed time:   1s,   0mn   1s)
done in 3.85s.
==> i_iter=3 / n_iter=5
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_3_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_3_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    3 (elapsed time:   1s,   0mn   1s)
done in 5.12s.
==> i_iter=4 / n_iter=8
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_4_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_4_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    5 (elapsed time:   1s,   0mn   1s)
done in 7.51s.
==> i_iter=5 / n_iter=13
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_5_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_5_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /    8 (elapsed time:   1s,   0mn   1s)
done in 11.14s.
==> i_iter=6 / n_iter=21
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_6_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_6_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   13 (elapsed time:   1s,   0mn   1s)
done in 17.43s.
==> i_iter=7 / n_iter=34
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_7_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_7_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   21 (elapsed time:   1s,   0mn   1s)
done in 27.45s.
==> i_iter=8 / n_iter=55
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_8_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_8_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   34 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   34 (elapsed time:  42s,   0mn  42s)
done in 44.75s.
==> i_iter=9 / n_iter=89
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_9_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_9_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   55 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   55 (elapsed time:  42s,   0mn  42s)
done in 70.99s.
==> i_iter=10 / n_iter=144
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_10_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_10_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   89 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   89 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   89 (elapsed time:  83s,   1mn  23s)
done in 114.04s.
==> i_iter=11 / n_iter=233
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_11_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_11_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   144 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   144 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   144 (elapsed time:  83s,   1mn  23s)
Iteration  97 /   144 (elapsed time:  124s,   2mn   4s)
Iteration  129 /   144 (elapsed time:  165s,   2mn  45s)
done in 185.46s.
==> i_iter=12 / n_iter=377
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_12_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_12_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   233 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   233 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   233 (elapsed time:  83s,   1mn  23s)
Iteration  97 /   233 (elapsed time:  124s,   2mn   4s)
Iteration  129 /   233 (elapsed time:  165s,   2mn  45s)
Iteration  161 /   233 (elapsed time:  207s,   3mn  27s)
Iteration  193 /   233 (elapsed time:  250s,   4mn  10s)
Iteration  225 /   233 (elapsed time:  292s,   4mn  52s)
done in 303.84s.
==> i_iter=13 / n_iter=610
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_13_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_13_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   377 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   377 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   377 (elapsed time:  84s,   1mn  24s)
Iteration  97 /   377 (elapsed time:  126s,   2mn   6s)
Iteration  129 /   377 (elapsed time:  167s,   2mn  47s)
Iteration  161 /   377 (elapsed time:  209s,   3mn  29s)
Iteration  193 /   377 (elapsed time:  250s,   4mn  10s)
Iteration  225 /   377 (elapsed time:  292s,   4mn  52s)
Iteration  257 /   377 (elapsed time:  334s,   5mn  34s)
Iteration  289 /   377 (elapsed time:  376s,   6mn  16s)
Iteration  321 /   377 (elapsed time:  418s,   6mn  58s)
Iteration  353 /   377 (elapsed time:  459s,   7mn  39s)
done in 491.29s.
==> i_iter=14 / n_iter=987
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_14_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_14_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   610 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   610 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   610 (elapsed time:  84s,   1mn  24s)
Iteration  97 /   610 (elapsed time:  125s,   2mn   5s)
Iteration  129 /   610 (elapsed time:  167s,   2mn  47s)
Iteration  161 /   610 (elapsed time:  208s,   3mn  28s)
Iteration  193 /   610 (elapsed time:  250s,   4mn  10s)
Iteration  225 /   610 (elapsed time:  291s,   4mn  51s)
Iteration  257 /   610 (elapsed time:  332s,   5mn  32s)
Iteration  289 /   610 (elapsed time:  373s,   6mn  13s)
Iteration  321 /   610 (elapsed time:  415s,   6mn  55s)
Iteration  353 /   610 (elapsed time:  455s,   7mn  35s)
Iteration  385 /   610 (elapsed time:  497s,   8mn  17s)
Iteration  417 /   610 (elapsed time:  538s,   8mn  58s)
Iteration  449 /   610 (elapsed time:  579s,   9mn  39s)
Iteration  481 /   610 (elapsed time:  620s,  10mn  20s)
Iteration  513 /   610 (elapsed time:  661s,  11mn   1s)
Iteration  545 /   610 (elapsed time:  702s,  11mn  42s)
Iteration  577 /   610 (elapsed time:  743s,  12mn  23s)
Iteration  609 /   610 (elapsed time:  784s,  13mn   4s)
done in 786.74s.
==> i_iter=15 / n_iter=1597
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_15_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_15_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   987 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   987 (elapsed time:  41s,   0mn  41s)
Iteration  65 /   987 (elapsed time:  82s,   1mn  22s)
Iteration  97 /   987 (elapsed time:  123s,   2mn   3s)
Iteration  129 /   987 (elapsed time:  164s,   2mn  44s)
Iteration  161 /   987 (elapsed time:  205s,   3mn  25s)
Iteration  193 /   987 (elapsed time:  246s,   4mn   6s)
Iteration  225 /   987 (elapsed time:  288s,   4mn  48s)
Iteration  257 /   987 (elapsed time:  328s,   5mn  28s)
Iteration  289 /   987 (elapsed time:  369s,   6mn   9s)
Iteration  321 /   987 (elapsed time:  411s,   6mn  51s)
Iteration  353 /   987 (elapsed time:  452s,   7mn  32s)
Iteration  385 /   987 (elapsed time:  493s,   8mn  13s)
Iteration  417 /   987 (elapsed time:  534s,   8mn  54s)
Iteration  449 /   987 (elapsed time:  575s,   9mn  35s)
Iteration  481 /   987 (elapsed time:  617s,  10mn  17s)
Iteration  513 /   987 (elapsed time:  658s,  10mn  58s)
Iteration  545 /   987 (elapsed time:  699s,  11mn  39s)
Iteration  577 /   987 (elapsed time:  740s,  12mn  20s)
Iteration  609 /   987 (elapsed time:  781s,  13mn   1s)
Iteration  641 /   987 (elapsed time:  822s,  13mn  42s)
Iteration  673 /   987 (elapsed time:  863s,  14mn  23s)
Iteration  705 /   987 (elapsed time:  904s,  15mn   4s)
Iteration  737 /   987 (elapsed time:  945s,  15mn  45s)
Iteration  769 /   987 (elapsed time:  986s,  16mn  26s)
Iteration  801 /   987 (elapsed time:  1028s,  17mn   8s)
Iteration  833 /   987 (elapsed time:  1068s,  17mn  48s)
Iteration  865 /   987 (elapsed time:  1109s,  18mn  29s)
Iteration  897 /   987 (elapsed time:  1151s,  19mn  11s)
Iteration  929 /   987 (elapsed time:  1191s,  19mn  51s)
Iteration  961 /   987 (elapsed time:  1232s,  20mn  32s)
done in 1266.19s.
==> i_iter=16 / n_iter=2584
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_16_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_16_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   1597 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   1597 (elapsed time:  42s,   0mn  42s)
Iteration  65 /   1597 (elapsed time:  82s,   1mn  22s)
Iteration  97 /   1597 (elapsed time:  123s,   2mn   3s)
Iteration  129 /   1597 (elapsed time:  164s,   2mn  44s)
Iteration  161 /   1597 (elapsed time:  205s,   3mn  25s)
Iteration  193 /   1597 (elapsed time:  246s,   4mn   6s)
Iteration  225 /   1597 (elapsed time:  287s,   4mn  47s)
Iteration  257 /   1597 (elapsed time:  329s,   5mn  29s)
Iteration  289 /   1597 (elapsed time:  370s,   6mn  10s)
Iteration  321 /   1597 (elapsed time:  410s,   6mn  50s)
Iteration  353 /   1597 (elapsed time:  451s,   7mn  31s)
Iteration  385 /   1597 (elapsed time:  492s,   8mn  12s)
Iteration  417 /   1597 (elapsed time:  533s,   8mn  53s)
Iteration  449 /   1597 (elapsed time:  574s,   9mn  34s)
Iteration  481 /   1597 (elapsed time:  615s,  10mn  15s)
Iteration  513 /   1597 (elapsed time:  656s,  10mn  56s)
Iteration  545 /   1597 (elapsed time:  697s,  11mn  37s)
Iteration  577 /   1597 (elapsed time:  738s,  12mn  18s)
Iteration  609 /   1597 (elapsed time:  779s,  12mn  59s)
Iteration  641 /   1597 (elapsed time:  820s,  13mn  40s)
Iteration  673 /   1597 (elapsed time:  861s,  14mn  21s)
Iteration  705 /   1597 (elapsed time:  902s,  15mn   2s)
Iteration  737 /   1597 (elapsed time:  943s,  15mn  43s)
Iteration  769 /   1597 (elapsed time:  983s,  16mn  23s)
Iteration  801 /   1597 (elapsed time:  1025s,  17mn   5s)
Iteration  833 /   1597 (elapsed time:  1065s,  17mn  45s)
Iteration  865 /   1597 (elapsed time:  1107s,  18mn  27s)
Iteration  897 /   1597 (elapsed time:  1150s,  19mn  10s)
Iteration  929 /   1597 (elapsed time:  1193s,  19mn  53s)
Iteration  961 /   1597 (elapsed time:  1234s,  20mn  34s)
Iteration  993 /   1597 (elapsed time:  1276s,  21mn  16s)
Iteration  1025 /   1597 (elapsed time:  1317s,  21mn  57s)
Iteration  1057 /   1597 (elapsed time:  1359s,  22mn  39s)
Iteration  1089 /   1597 (elapsed time:  1401s,  23mn  21s)
Iteration  1121 /   1597 (elapsed time:  1443s,  24mn   3s)
Iteration  1153 /   1597 (elapsed time:  1484s,  24mn  44s)
Iteration  1185 /   1597 (elapsed time:  1526s,  25mn  26s)
Iteration  1217 /   1597 (elapsed time:  1568s,  26mn   8s)
Iteration  1249 /   1597 (elapsed time:  1610s,  26mn  50s)
Iteration  1281 /   1597 (elapsed time:  1651s,  27mn  31s)
Iteration  1313 /   1597 (elapsed time:  1693s,  28mn  13s)
Iteration  1345 /   1597 (elapsed time:  1735s,  28mn  55s)
Iteration  1377 /   1597 (elapsed time:  1777s,  29mn  37s)
Iteration  1409 /   1597 (elapsed time:  1818s,  30mn  18s)
Iteration  1441 /   1597 (elapsed time:  1860s,  31mn   0s)
Iteration  1473 /   1597 (elapsed time:  1901s,  31mn  41s)
Iteration  1505 /   1597 (elapsed time:  1943s,  32mn  23s)
Iteration  1537 /   1597 (elapsed time:  1984s,  33mn   4s)
Iteration  1569 /   1597 (elapsed time:  2026s,  33mn  46s)
done in 2063.32s.
==> i_iter=17 / n_iter=4181
No cache found /tmp/cache_dir/2019-09-11_Perrinet19_HAP_17_dico.pkl: Learning the dictionary with algo = mp 
 resuming the learning on : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_17_dico.pkl
Training on 65520 patches
[dict_learning] Iteration   1 /   2584 (elapsed time:   1s,   0mn   1s)
Iteration  33 /   2584 (elapsed time:  43s,   0mn  43s)
Iteration  65 /   2584 (elapsed time:  85s,   1mn  25s)
Iteration  97 /   2584 (elapsed time:  127s,   2mn   7s)
Iteration  129 /   2584 (elapsed time:  168s,   2mn  48s)
Iteration  161 /   2584 (elapsed time:  209s,   3mn  29s)
Iteration  193 /   2584 (elapsed time:  250s,   4mn  10s)
Iteration  225 /   2584 (elapsed time:  291s,   4mn  51s)
Iteration  257 /   2584 (elapsed time:  332s,   5mn  32s)
Iteration  289 /   2584 (elapsed time:  373s,   6mn  13s)
Iteration  321 /   2584 (elapsed time:  414s,   6mn  54s)
Iteration  353 /   2584 (elapsed time:  455s,   7mn  35s)
Iteration  385 /   2584 (elapsed time:  496s,   8mn  16s)
Iteration  417 /   2584 (elapsed time:  538s,   8mn  58s)
Iteration  449 /   2584 (elapsed time:  578s,   9mn  38s)
Iteration  481 /   2584 (elapsed time:  619s,  10mn  19s)
Iteration  513 /   2584 (elapsed time:  661s,  11mn   1s)
Iteration  545 /   2584 (elapsed time:  701s,  11mn  41s)
Iteration  577 /   2584 (elapsed time:  743s,  12mn  23s)
Iteration  609 /   2584 (elapsed time:  784s,  13mn   4s)
Iteration  641 /   2584 (elapsed time:  826s,  13mn  46s)
Iteration  673 /   2584 (elapsed time:  866s,  14mn  26s)
Iteration  705 /   2584 (elapsed time:  908s,  15mn   8s)
Iteration  737 /   2584 (elapsed time:  949s,  15mn  49s)
Iteration  769 /   2584 (elapsed time:  990s,  16mn  30s)
Iteration  801 /   2584 (elapsed time:  1031s,  17mn  11s)
Iteration  833 /   2584 (elapsed time:  1072s,  17mn  52s)
Iteration  865 /   2584 (elapsed time:  1113s,  18mn  33s)
Iteration  897 /   2584 (elapsed time:  1154s,  19mn  14s)
Iteration  929 /   2584 (elapsed time:  1195s,  19mn  55s)
Iteration  961 /   2584 (elapsed time:  1237s,  20mn  37s)
Iteration  993 /   2584 (elapsed time:  1278s,  21mn  18s)
Iteration  1025 /   2584 (elapsed time:  1319s,  21mn  59s)
Iteration  1057 /   2584 (elapsed time:  1360s,  22mn  40s)
Iteration  1089 /   2584 (elapsed time:  1401s,  23mn  21s)
Iteration  1121 /   2584 (elapsed time:  1442s,  24mn   2s)
Iteration  1153 /   2584 (elapsed time:  1483s,  24mn  43s)
Iteration  1185 /   2584 (elapsed time:  1524s,  25mn  24s)
Iteration  1217 /   2584 (elapsed time:  1565s,  26mn   5s)
Iteration  1249 /   2584 (elapsed time:  1607s,  26mn  47s)
Iteration  1281 /   2584 (elapsed time:  1647s,  27mn  27s)
Iteration  1313 /   2584 (elapsed time:  1688s,  28mn   8s)
Iteration  1345 /   2584 (elapsed time:  1729s,  28mn  49s)
Iteration  1377 /   2584 (elapsed time:  1770s,  29mn  30s)
Iteration  1409 /   2584 (elapsed time:  1812s,  30mn  12s)
Iteration  1441 /   2584 (elapsed time:  1852s,  30mn  52s)
Iteration  1473 /   2584 (elapsed time:  1893s,  31mn  33s)
Iteration  1505 /   2584 (elapsed time:  1934s,  32mn  14s)
Iteration  1537 /   2584 (elapsed time:  1976s,  32mn  56s)
Iteration  1569 /   2584 (elapsed time:  2017s,  33mn  37s)
Iteration  1601 /   2584 (elapsed time:  2058s,  34mn  18s)
Iteration  1633 /   2584 (elapsed time:  2099s,  34mn  59s)
Iteration  1665 /   2584 (elapsed time:  2140s,  35mn  40s)
Iteration  1697 /   2584 (elapsed time:  2181s,  36mn  21s)
Iteration  1729 /   2584 (elapsed time:  2223s,  37mn   3s)
Iteration  1761 /   2584 (elapsed time:  2264s,  37mn  44s)
Iteration  1793 /   2584 (elapsed time:  2305s,  38mn  25s)
Iteration  1825 /   2584 (elapsed time:  2346s,  39mn   6s)
Iteration  1857 /   2584 (elapsed time:  2387s,  39mn  47s)
Iteration  1889 /   2584 (elapsed time:  2428s,  40mn  28s)
Iteration  1921 /   2584 (elapsed time:  2469s,  41mn   9s)
Iteration  1953 /   2584 (elapsed time:  2510s,  41mn  50s)
Iteration  1985 /   2584 (elapsed time:  2552s,  42mn  32s)
Iteration  2017 /   2584 (elapsed time:  2594s,  43mn  14s)
Iteration  2049 /   2584 (elapsed time:  2637s,  43mn  57s)
Iteration  2081 /   2584 (elapsed time:  2678s,  44mn  38s)
Iteration  2113 /   2584 (elapsed time:  2720s,  45mn  20s)
Iteration  2145 /   2584 (elapsed time:  2761s,  46mn   1s)
Iteration  2177 /   2584 (elapsed time:  2803s,  46mn  43s)
Iteration  2209 /   2584 (elapsed time:  2844s,  47mn  24s)
Iteration  2241 /   2584 (elapsed time:  2886s,  48mn   6s)
Iteration  2273 /   2584 (elapsed time:  2928s,  48mn  48s)
Iteration  2305 /   2584 (elapsed time:  2970s,  49mn  30s)
Iteration  2337 /   2584 (elapsed time:  3012s,  50mn  12s)
Iteration  2369 /   2584 (elapsed time:  3054s,  50mn  54s)
Iteration  2401 /   2584 (elapsed time:  3096s,  51mn  36s)
Iteration  2433 /   2584 (elapsed time:  3137s,  52mn  17s)
Iteration  2465 /   2584 (elapsed time:  3178s,  52mn  58s)
Iteration  2497 /   2584 (elapsed time:  3220s,  53mn  40s)
Iteration  2529 /   2584 (elapsed time:  3261s,  54mn  21s)
Iteration  2561 /   2584 (elapsed time:  3302s,  55mn   2s)
done in 3332.34s.
In [7]:
phi = (np.sqrt(5) + 1. ) /2
fig_width = 15
dpi_export = 300
#dpi_export = 0
colors = ['black', 'orange', 'blue', 'red']

import matplotlib.pyplot as plt
def plot_dico(dico, color, dim_graph = (8, 8)):
    subplotpars = dict(left=0.05, right=.95, bottom=0.05, top=.95, wspace=0.05, hspace=0.05,)
    fig, axs = plt.subplots(1, 2, figsize=(fig_width, fig_width/phi), gridspec_kw=subplotpars)
    for ax in axs:
        ax.axis(c='b', lw=2, axisbg='w')
        ax.set_facecolor('w')
        
    from shl_scripts import show_dico
    fig, axs[0] = show_dico(shl, dico, data=data, dim_graph=dim_graph, fig=fig, ax=axs[0], order=False, seed=51)
    
    if False:
        from shl_scripts import plot_P_cum
        fig, axs[1] = plot_P_cum(dico.P_cum, ymin=0.6, ymax=1.001, 
                             title=None, suptitle=None, ylabel='non-linear functions', 
                             verbose=False, n_yticks=21, alpha=.02, c=color, fig=fig, ax=axs[1])
        axs[1].plot([0], [0], lw=1, color=color, label=homeo_method, alpha=.6)
    
    else:
        from shl_scripts import plot_proba_histogram
        coding = shl.code(data, dico)
        fig, axs[1] = plot_proba_histogram(coding, fig=fig, ax=axs[1])
        axs[1].plot([0], [0], lw=1, color=color, label=homeo_method, alpha=.6)
    # ax.set_ylabel(homeo_method)

    #ax.text(-8, 7*dim_graph[0], homeo_method, fontsize=12, color='k', rotation=90)#, backgroundcolor='white'
    #axs[1].legend(loc='lower right')
    # pos : [left, bottom, width, height] =    The new position of the in `.Figure` coordinates.
    axs[0].set_position([0.0, 0.0, .618, 1.0])
    axs[1].set_position([0.618+0.05, 0.0+0.05, .382-0.07, 1.0-0.052])

    return fig, axs

for homeo_method, color in zip(homeo_methods, colors):
    print(f'=> homeo_method={homeo_method}')
    flockname = os.path.join(shl.cache_dir, f'{name}_{homeo_method}_lock')
    if not os.path.isfile(flockname):
        for i_step in range(N_step):
            dico = shl.learn_dico(data=data, matname=f'{name}_{homeo_method}_{i_step}', list_figures=[])

            print(f'==> i_iter={i_step} / n_iter={fibo[i_step+1]}')
            figname = f'/tmp/{name}_{homeo_method}_{i_step}.png'
            if not os.path.isfile(figname):
                fig, axs = plot_dico(dico, color)
                axs[1].set_ylim(0., 1.9)
                axs[1].text(32, 0.1, f'homeo_method={homeo_method}', fontsize=24, color=color, backgroundcolor='white')
                axs[1].text(32, 1.75, f'n_iter={fibo[i_step+1]}', fontsize=24, color='k', backgroundcolor='white')
                plt.show()
                if dpi_export > 0 : fig.savefig(figname, dpi=dpi_export, bbox_inches='tight')
          
=> homeo_method=None
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_0_dico.pkl
==> i_iter=0 / n_iter=1
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_1_dico.pkl
==> i_iter=1 / n_iter=2
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_2_dico.pkl
==> i_iter=2 / n_iter=3
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_3_dico.pkl
==> i_iter=3 / n_iter=5
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_4_dico.pkl
==> i_iter=4 / n_iter=8
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_5_dico.pkl
==> i_iter=5 / n_iter=13
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_6_dico.pkl
==> i_iter=6 / n_iter=21
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_7_dico.pkl
==> i_iter=7 / n_iter=34
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_8_dico.pkl
==> i_iter=8 / n_iter=55
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_9_dico.pkl
==> i_iter=9 / n_iter=89
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_10_dico.pkl
==> i_iter=10 / n_iter=144
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_11_dico.pkl
==> i_iter=11 / n_iter=233
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_12_dico.pkl
==> i_iter=12 / n_iter=377
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_13_dico.pkl
==> i_iter=13 / n_iter=610
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_14_dico.pkl
==> i_iter=14 / n_iter=987
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_15_dico.pkl
==> i_iter=15 / n_iter=1597
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_16_dico.pkl
==> i_iter=16 / n_iter=2584
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_None_17_dico.pkl
==> i_iter=17 / n_iter=4181
Coding data with algorithm  mp 
=> homeo_method=OLS
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_0_dico.pkl
==> i_iter=0 / n_iter=1
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_1_dico.pkl
==> i_iter=1 / n_iter=2
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_2_dico.pkl
==> i_iter=2 / n_iter=3
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_3_dico.pkl
==> i_iter=3 / n_iter=5
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_4_dico.pkl
==> i_iter=4 / n_iter=8
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_5_dico.pkl
==> i_iter=5 / n_iter=13
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_6_dico.pkl
==> i_iter=6 / n_iter=21
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_7_dico.pkl
==> i_iter=7 / n_iter=34
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_8_dico.pkl
==> i_iter=8 / n_iter=55
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_9_dico.pkl
==> i_iter=9 / n_iter=89
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_10_dico.pkl
==> i_iter=10 / n_iter=144
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_11_dico.pkl
==> i_iter=11 / n_iter=233
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_12_dico.pkl
==> i_iter=12 / n_iter=377
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_13_dico.pkl
==> i_iter=13 / n_iter=610
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_14_dico.pkl
==> i_iter=14 / n_iter=987
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_15_dico.pkl
==> i_iter=15 / n_iter=1597
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_16_dico.pkl
==> i_iter=16 / n_iter=2584
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_OLS_17_dico.pkl
==> i_iter=17 / n_iter=4181
Coding data with algorithm  mp 
=> homeo_method=HEH
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_0_dico.pkl
==> i_iter=0 / n_iter=1
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_1_dico.pkl
==> i_iter=1 / n_iter=2
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_2_dico.pkl
==> i_iter=2 / n_iter=3
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_3_dico.pkl
==> i_iter=3 / n_iter=5
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_4_dico.pkl
==> i_iter=4 / n_iter=8
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_5_dico.pkl
==> i_iter=5 / n_iter=13
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_6_dico.pkl
==> i_iter=6 / n_iter=21
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_7_dico.pkl
==> i_iter=7 / n_iter=34
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_8_dico.pkl
==> i_iter=8 / n_iter=55
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_9_dico.pkl
==> i_iter=9 / n_iter=89
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_10_dico.pkl
==> i_iter=10 / n_iter=144
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_11_dico.pkl
==> i_iter=11 / n_iter=233
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_12_dico.pkl
==> i_iter=12 / n_iter=377
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_13_dico.pkl
==> i_iter=13 / n_iter=610
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_14_dico.pkl
==> i_iter=14 / n_iter=987
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_15_dico.pkl
==> i_iter=15 / n_iter=1597
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_16_dico.pkl
==> i_iter=16 / n_iter=2584
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HEH_17_dico.pkl
==> i_iter=17 / n_iter=4181
Coding data with algorithm  mp 
=> homeo_method=HAP
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_0_dico.pkl
==> i_iter=0 / n_iter=1
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_1_dico.pkl
==> i_iter=1 / n_iter=2
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_2_dico.pkl
==> i_iter=2 / n_iter=3
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_3_dico.pkl
==> i_iter=3 / n_iter=5
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_4_dico.pkl
==> i_iter=4 / n_iter=8
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_5_dico.pkl
==> i_iter=5 / n_iter=13
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_6_dico.pkl
==> i_iter=6 / n_iter=21
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_7_dico.pkl
==> i_iter=7 / n_iter=34
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_8_dico.pkl
==> i_iter=8 / n_iter=55
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_9_dico.pkl
==> i_iter=9 / n_iter=89
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_10_dico.pkl
==> i_iter=10 / n_iter=144
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_11_dico.pkl
==> i_iter=11 / n_iter=233
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_12_dico.pkl
==> i_iter=12 / n_iter=377
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_13_dico.pkl
==> i_iter=13 / n_iter=610
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_14_dico.pkl
==> i_iter=14 / n_iter=987
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_15_dico.pkl
==> i_iter=15 / n_iter=1597
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_16_dico.pkl
==> i_iter=16 / n_iter=2584
Coding data with algorithm  mp 
loading the dico called : /tmp/cache_dir/2019-09-11_Perrinet19_HAP_17_dico.pkl
==> i_iter=17 / n_iter=4181
Coding data with algorithm  mp 

Creating the movie using the (excellent) MoviePy library:

In [12]:
from moviepy.editor import VideoFileClip, ImageClip, TextClip, CompositeVideoClip


H = 500
W = 800
SIZE = (W, H)


# a list of sub clips that will be compsited at the end
clip = []
t = 0 
texts = ["An Adaptive Homeostatic Algorithm\n for the Unsupervised Learning\n of Visual Features",
         "as published Sep 2019\n in the journal Vision"
        ]
colors_intro = ['orange', 'white']

txt_opts = dict(fontsize=50, font="Amiri-Bold", stroke_color='gray', stroke_width=.5, size=(W,H))
duration = 2
for text, color in zip(texts, colors_intro):
    txt_clip = TextClip(text, color=color, **txt_opts)
    txt_clip = txt_clip.set_start(t).set_pos('center').set_duration(duration)#.resize(height=H, width=W)
    
    t += duration
    clip.append(txt_clip)
    

sub_opts = dict(fontsize=32, font="Amiri-Bold", stroke_color='gray',  method='caption', align='South', 
                stroke_width=.5, size=(W,H))
for subtitle in ["This paper shows the role of... ", "... homeostasis mechanisms ...", "... in unsupervised learning algorithms."]:
    sub_duration = 1.5
    sub_clip = TextClip(subtitle, color='yellow', **sub_opts)
    sub_clip = sub_clip.set_start(t).set_duration(sub_duration) #set_pos('bottom').
    t += sub_duration
    clip.append(sub_clip)    
    
texts = ["Without homeostasis", "Olshausen (1997)", "Histogram Equalization", "Activation Probability"]
subtitles = {}
subtitles['None'] = [
    'I show here the result of a simple algorithm of ...',
    '... unsupervised learning based on sparse coding.',
    'On the left, we show 64 randomly picked kernels...',
    '... from the 661 receptive fields of the neurons and ...',
    '... on the right the histogram of activation probability.',
    '... Looking at results as learning iterates, ...',
    '... edge-like filters appear after some iterations...',
    '... but the histogram shows a desequilibrium in the ...',
    '... activation probability, even though  ...',
    '... the norm of the kernels are normalized.',
]
subtitles['OLS'] = [
    'The original algorithm developped ...',
    '... by Olshausen and Field (1997) included a more  ...',
    '... elaborated adaptation of this norm based on  ...',
    "... coefficients' energy, yielding a better balance...",
    '... and a better looking set of filters.',
    'Still, this causes an under-optimisation of the ... ',
    '... representation as some neurons are a priori ...',
    '... more likely to be selected than others.',
    ' A proper homeostasis is necessary.'
]
subtitles['HEH'] = [
    'Such an objective can be simply optimized...',
    '... by introducing an adaptive non-linearity in our ...',
    '... sparse coding algorithm. This non-linearity  ...',
    '... is based on well-known histogram equalization ...',
    '... to make sure that all neurons are always picked up.',
    '...  with a priori the same probability ...',
    '... We called it Histogram Equalization Homeostasis ...',
    '... and it effectively works very well, as well ...',
    '... qualitatively (left) ...', '... than quantitatively (right).',
]
subtitles['HAP'] = [
    'A problem of Histogram Equalization Homeostasis ...',
    '... is that it is computationally more expensive  ...',
    '... and less plausible to be implemented in real ...',
    '...  biological neurons. We thus explored another ...',
    '... algorithm simply based on  activation probability.',
    'This Homeostasis on Activation Probability  ... ',
    '... performed qualitatively as well as HEH ...',
    '... and also quantitatively similarly ...',
    'Yet it comes at a very low cost and it is ...',
    '... compatible with biomimetic algorithms.',
]

# http://zulko.github.io/moviepy/ref/VideoClip/VideoClip.html?highlight=compositevideoclip#textclip
txt_opts = dict(fontsize=65, font="Amiri-Bold", stroke_color='gray', stroke_width=2.5, size=(W,H), bg_color='white')
sub_opts = dict(fontsize=32, font="Amiri-Bold", stroke_color='gray',  method='caption', align='South', 
                stroke_width=.5, size=(W,H))
for homeo_method, text, color in zip(homeo_methods, texts, colors):
    print(f'=> homeo_method={homeo_method}')
    duration = 1
    txt_clip = TextClip(text, color=color, **txt_opts)
    txt_clip = txt_clip.set_start(t).set_pos('center').set_duration(duration)
    t += duration
    clip.append(txt_clip)

    for i_step in range(N_step):
        duration = 1
        im_clip = ImageClip(f'/tmp/{name}_{homeo_method}_{i_step}.png')
        im_clip = im_clip.set_start(t).set_duration(duration).set_pos('top').resize(height=int(H*.925), width=int(W*.925))
        t += duration
        clip.append(im_clip)

    # please be kind, rewind
    t_sub = t - duration * N_step
    sub_duration = duration * N_step / len(subtitles[homeo_method])
    for subtitle in subtitles[homeo_method]:
        sub_clip = TextClip(subtitle, color='yellow', **sub_opts)
        sub_clip = sub_clip.set_start(t_sub).set_duration(sub_duration) #set_pos('bottom').
        t_sub += sub_duration
        clip.append(sub_clip)
        
texts = ["... for more info,\n and open-sourced code\n visit ",
    "https://laurentperrinet.github.io/publication/perrinet-19"]
colors_outro = ['orange', 'white']

txt_opts = dict(fontsize=30, font="Amiri-Bold", stroke_color='gray', stroke_width=.5, size=(W,H))
duration = 3
for text, color in zip(texts, colors_outro):
    txt_clip = TextClip(text, color=color, **txt_opts)
    txt_clip = txt_clip.set_start(t).set_pos('center').set_duration(duration)
    t += duration
    clip.append(txt_clip)
      

# Overlay the text clip on the first video clip
video = CompositeVideoClip(clip)
vext = 'mp4'
# Write the result to a file (many options available !)
video.write_videofile(f'../files/{name}.{vext}', fps=5)
=> homeo_method=None
=> homeo_method=OLS
=> homeo_method=HEH
=> homeo_method=HAP
t:   1%|          | 4/453 [00:00<00:11, 39.15it/s, now=None]
Moviepy - Building video ../files/2019-09-11_Perrinet19.mp4.
Moviepy - Writing video ../files/2019-09-11_Perrinet19.mp4

                                                              
Moviepy - Done !
Moviepy - video ready ../files/2019-09-11_Perrinet19.mp4
In [13]:
!open  ../files/2019-09-11_Perrinet19.mp4

some book keeping for the notebook

In [10]:
%load_ext version_information
%version_information numpy, scipy, matplotlib, MotionClouds
Out[10]:
Software Version
Python 3.7.4 64bit [Clang 10.0.1 (clang-1001.0.46.4)]
IPython 7.8.0
OS Darwin 18.7.0 x86_64 i386 64bit
numpy 1.17.2
scipy 1.3.1
matplotlib 3.1.1
MotionClouds 20180606
Sat Sep 14 09:51:28 2019 CEST

Comments

Comments powered by Disqus